package com.zyz.G_常用类.字符串;

/**
 * @author: vick
 * @Date: 2025/3/19
 * @Description:
 * @version: 1.0
 */
public class Demo5 {
    public static void main(String[] args) {
        StringBuilder stringBuilder = new StringBuilder("abc");
        stringBuilder.append(1);
        System.out.println(stringBuilder);
        stringBuilder.append("2");
        System.out.println(stringBuilder);

        stringBuilder.delete(2,4);
        System.out.println(stringBuilder);

        stringBuilder.setCharAt(2, 'o');
        System.out.println(stringBuilder);

        stringBuilder.insert(1, false);
        System.out.println(stringBuilder);

        StringBuilder reverse = stringBuilder.reverse();
        System.out.println(reverse);

        String substring = stringBuilder.substring(1, 3);
        System.out.println(substring);
    }
}
